package com.qdsg.modulesihealsdk.detectStrategy.control;

import android.content.Context;

/**
 * @Description
 * @Author WuJianFeng
 * @Date 2022/11/21 15:17
 */
public class DetectDeal {
    public static volatile DetectDeal detectDeal;
    public static DetectDeal getInstance(){
        if (detectDeal == null){
            synchronized (DetectDeal.class){
                if (detectDeal == null){
                    detectDeal = new DetectDeal();
                }
            }
        }
        return detectDeal;
    }


    private DetectBusiness detectBusiness;

    public DetectBusiness getDetectBusiness(){
        return detectBusiness;
    }

    public DetectDeal setDetectStrategy(DetectBusiness detectBusiness){
        this.detectBusiness = detectBusiness;
        return this;
    }

    public void dealDetect(Context context, StrategyCallback strategyCallback){
        if (detectBusiness != null){
            detectBusiness.dealDetect(context, strategyCallback);
        }
    }

    public void stopThread(){
        if (detectBusiness != null){
            detectBusiness.stopThread();
        }
    }

}
